<ion-header>
  <ion-toolbar>
    <ion-title>
      修改密码
    </ion-title>
    <ion-buttons>
      <button ion-button (click)="dismiss()">关闭</button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form [formGroup]="form" (ngSubmit)="onSubmit()">
    <ion-list>
      <ion-item>
        <ion-label floating>请输入旧密码</ion-label>
        <ion-input type="password" formControlName="oldPsw"></ion-input>
      </ion-item>
      <div *ngIf="verifyMessages.oldPsw.errorMsg" class="validation-failed">{{verifyMessages.oldPsw.errorMsg}}</div>

      <ion-item>
        <ion-label floating>请输入新密码</ion-label>
        <ion-input type="password" formControlName="newPsw" (input)="input($event.target.value)"></ion-input>
      </ion-item>
      <div *ngIf="verifyMessages.newPsw.errorMsg" class="validation-failed">{{verifyMessages.newPsw.errorMsg}}</div>
      <div class="strength">
        <div>密码强度：</div>
        <div class="bar" [ngClass]="{'low': strength.low, 'middle': strength.middle, 'high': strength.high}"></div>
      </div>
      <ion-item>
        <ion-label floating>请再次输入新密码</ion-label>
        <ion-input type="password" formControlName="newPsw2"></ion-input>
      </ion-item>
      <div *ngIf="verifyMessages.newPsw2.errorMsg" class="validation-failed">{{verifyMessages.newPsw2.errorMsg}}</div>

    </ion-list>
    <div padding-horizontal>
      <button type="submit" ion-button block [disabled]="!form.valid">保 存</button>
    </div>
  </form>
</ion-content>
